var userInfo;
Jes.extend({
	getUserSess : function(type){
		Jes.sync(function(){Jes.action("getUserSess",false,function(data){userInfo = data;});});
		if(!userInfo){
			if(type == 1) alert("Session过期，请重新登入！"),parent.Jes.url("../../jesacl/html/login.html");
			else Jes.url("../config/error.html");
			return false;
		}else{
			return true;
		}
	}
	,isFlowAdmin : function(){
		return userInfo.roles.indexOf('flowadmin')!=-1;
	}
});

//__________________________________________________附件通用代码begin________________________________________________________//

JesAttach = {
	/**
	* @todo：清除session附件
	* @date：2008-7-28 11:19
	* @author：hyh
	*/
	clearAttach : function(){
		Jes.action("removeSessAttr","ATTACH_LIST");
	}
	/**
	* @todo：删除上传附件
	* @date：2008-7-28 16:54
	* @author：hyh
	*/
	,delAttachRow : function(td,id,attachname){
		DWRUtil.useLoadingMessage("正在读取数据...");
		var info = "你确定要删除上传附件吗？";
		if(id != "") info = "你确定附件在数据库删除吗？";
		if(confirm(info)){
			var row = td.parentElement.parentElement;
			var tb = td.parentElement.parentElement.parentElement.parentElement;
		    tb.deleteRow(row.rowIndex);
		    Jes.action("deleteAttach",id,attachname);
		}
	}
}
//__________________________________________________附件通用代码end__________________________________________________________//
//所有下拉框
Jes.Select={}